<template>
  <div class="box">
    <!-- 首页页面内容 -->
    <div class="box_top">
      <!-- 头部 -->
      <div class="box_top_head">
        <van-nav-bar title="首页" />
      </div>

      <!-- 轮播图 -->
      <div class="box_top_slideshow">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
          <van-swipe-item>1</van-swipe-item>
          <van-swipe-item>2</van-swipe-item>
          <van-swipe-item>3</van-swipe-item>
          <van-swipe-item>4</van-swipe-item>
        </van-swipe>
      </div>
      <!-- 中部产品 -->
      <div class="box_top_product">
        <van-grid>
          <van-grid-item icon="photo-o" text="文字" />
          <van-grid-item icon="photo-o" text="文字" />
          <van-grid-item icon="photo-o" text="文字" />
          <van-grid-item icon="photo-o" text="文字" />
        </van-grid>
      </div>
    </div>
    <!-- 底部导航组件 -->
    <bottomtab></bottomtab>
  </div>
</template>

<script>
import bottomtab from "../../components/bottomtab";
export default {
  data() {
    return {
      current: 0
    };
  },
  created(){
  },
  // 注册组件
  components: {
    bottomtab
  },
  methods: {
    onChange(index) {
      this.current = index;
    }
  }
};
</script>

<style scoped lang="less">
.box {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  .box_top {
    background-color: #f7f8fa;
    height: calc(100vh - 51px); //底部加1px的边框
    overflow: auto;
    border-bottom: 1px solid #f3f3f3;
    .box_top_head {
      position: fixed;
      width: 100%;
      top: 0;
      left: 0;
      height: 46px;
      background-color: #fff;
      z-index: 10;
    }
    .box_top_slideshow {
      margin-top: 46px;
      width: 100%;
      height: 200px;
    }
    .box_top_product {
      width: 100%;
    }
  }
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 200px;
  text-align: center;
  background-color: #39a9ed;
}
</style>
